package com.gugee.ins.common.dal.service.statistics.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gugee.ins.common.dal.mapper.statistics.InsStBloggerFlBrandCategoryMapper;
import com.gugee.ins.common.dal.service.statistics.InsStBloggerFlBrandCategoryDao;
import com.gugee.ins.common.model.mysql.statistics.InsStBloggerFlBrandCategory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * InsStBloggerFlBrandCategoryDao
 * @author Huangxin
 */
@Slf4j
@Service
public class InsStBloggerFlBrandCategoryDaoImpl extends ServiceImpl<InsStBloggerFlBrandCategoryMapper,InsStBloggerFlBrandCategory> implements InsStBloggerFlBrandCategoryDao {

    /**
     * 删除活跃粉丝品牌博主的分类占比
     * @param uid
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteByUid(long uid) {
        baseMapper.deleteByUid(uid);
    }

    /**
     * 获取活跃粉丝品牌博主的分类占比
     * @param uid
     * @param limit
     * @return
     */
    @Override
    public List<InsStBloggerFlBrandCategory> findActiveFollowerBrandCategoryRateByUid(long uid, int limit) {
        return baseMapper.findActiveFollowerBrandCategoryRateByUid(uid,limit);
    }

    /**
     * 获取活跃粉丝品牌博主的分类占比
     * @param uid
     * @param limit
     * @return
     */
    @Override
    public List<InsStBloggerFlBrandCategory> findActiveFollowerCategoryRateByUid(long uid, int limit) {
        return baseMapper.findActiveFollowerCategoryRateByUid(uid,limit);
    }
}
